package de.hwr.sudokuspielehr.ui.listener;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import de.hwr.sudokuspielehr.ui.UserInterface;

/**
 * 
 * @author J. Reischauer
 * 
 */
public class PossibleNumbersListener implements ActionListener {
	/**
	 * User interface instance.
	 */
	private UserInterface ui;

	/**
	 * Constructor of PossibleNumbersListener.
	 * 
	 * @param pUi
	 */
	public PossibleNumbersListener(UserInterface pUi) {
		ui = pUi;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if (ui.isInPossibleNumbersMode()) {
			ui.enablePossibleNumbersMode(false);
		} else {
			ui.enablePossibleNumbersMode(true);
		}
	}
}
